import com.sun.source.tree.NewArrayTree;
import org.junit.Assert;
import org.junit.Test;

import java.util.*;

public class NGuessNumberTest {

    @Test
    public void generateAnswerTest(){
        List<Integer> list = NGuessNumber.generateAnswer();
        Assert.assertEquals("数量不是四个",list.size(),4);
        Set<Integer> set = new HashSet<>(list);
        Assert.assertEquals("存在重复值",set.size(),4);
        Assert.assertEquals("最大值错误",Collections.max(set) <= 9 ? 0 : 1,0);

    }

    @Test
    public void  getPlayerInputTest(){
        List<Integer> list = NGuessNumber.getPlayerInput();
        Assert.assertEquals("用户输入数量不是四个",list.size(),4);

    }

    @Test
    public void compareGuessAnswerTest(){
        List<Integer> one = new LinkedList<>();
        List<Integer> two = new LinkedList<>();
        for (int i = 0; i < 4; i++) {
            one.add(i);
            two.add(i);
        }
        System.out.println(NGuessNumber.compareGuessAnswer(one, two));

    }
}
